import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

// 定义路由
const routes = [
  { path: "/", component: () => import("@/views/home/index.vue") },
  { path: "/home", component: () => import("@/views/home/index.vue") },
  { path: "/article", component: () => import("@/views/article/index.vue") },
  { path: "/articleDetail/:id", component: () => import("@/views/articleDetail/index.vue") },
  { path: "/category", component: () => import("@/views/category/index.vue") },
  { path: "/tool", component: () => import("@/views/tool/index.vue") },
  { path: "/about", component: () => import("@/views/about/index.vue") },
  { path: "/collect", component: () => import("@/views/collect/index.vue") },
];

// 创建路由实例
// debugger;
const router = new VueRouter({
  mode: "history",
  routes, // 缩写是 `routes: routes`
  // base: "/assets/",
});

export default router;
